:root {
    --primary-color: #4CAF50;
    --primary-light: #81C784;
    --primary-dark: #388E3C;
    --secondary-color: #607D8B;
    --danger-color: #F44336;
    --warning-color: #FFC107;
    --info-color: #2196F3;
    --sidebar-bg: #2E3A4D;
    --sidebar-text: #BFCBD9;
    --sidebar-active: #3A4A5F;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e1e4e8;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f5f7fa;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
}

.sidebar-header .logo img {
    width: 36px;
    height: 36px;
    margin-right: 10px;
}

.sidebar-header .logo h2 {
    color: var(--white);
    font-size: 1.2rem;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu li:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.sidebar-menu li.active {
    background-color: var(--sidebar-active);
    border-left-color: var(--primary-color);
    color: var(--white);
}

.sidebar-menu li i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--white);
}

.logout-btn i {
    margin-right: 10px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    min-height: 100vh;
    overflow-x: hidden;
}

.main-header {
    background-color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.user-info {
    display: flex;
    align-items: center;
}

.welcome {
    margin-right: 1rem;
    color: var(--text-light);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* 页面内容 */
.page-content {
    padding: 2rem;
}

/* 工具栏 */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.search-box i {
    padding: 0 1rem;
    color: var(--text-light);
}

.search-box input {
    padding: 0.6rem;
    border: none;
    outline: none;
    min-width: 250px;
}

.search-btn {
    padding: 0.6rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}

/* 表格样式 */
.table-container {
    position: relative;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--text-light);
}

tr:hover {
    background-color: #f8f9fa;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
}

.btn i {
    margin-right: 0.3rem;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
}

.danger-btn {
    background-color: var(--danger-color);
    color: white;
}

.success-btn {
    background-color: var(--primary-color);
    color: white;
}

/* 状态标签 */
.status-active {
    color: var(--primary-color);
    font-weight: 500;
}

.status-inactive {
    color: var(--danger-color);
    font-weight: 500;
}

/* 分页 */
.pagination-wrapper {
    display: flex;
    justify-content: flex-end;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.5rem 0.8rem;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9rem;
    color: var(--text-light);
}

.page-select {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: var(--white);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: modalFadeIn 0.3s;
}

.modal-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    flex-direction: column;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(76, 175, 80, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-overlay span {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* 动画 */
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
} 

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .page-toolbar {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
    }
}


    /* ===== 仪表盘特定样式 ===== */
    .dashboard-page {
        padding: 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    /* 控制栏样式 */
    .dashboard-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .time-filter {
        display: flex;
        gap: 0.5rem;
    }
    
    .time-btn {
        padding: 0.5rem 1rem;
        border: 1px solid var(--border-color);
        border-radius: 20px;
        background: white;
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.2s;
    }
    
    .time-btn.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    /* 指标展示区 */
    .metric-showcase {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .metric-card {
        background: white;
        border-radius: 10px;
        padding: 1.5rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        display: flex;
        align-items: center;
        gap: 1.5rem;
        transition: transform 0.3s;
    }
    
    .metric-card.highlight {
        border-left: 4px solid var(--primary-color);
    }
    
    .metric-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    
    .metric-icon {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: rgba(76, 175, 80, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: var(--primary-color);
    }
    
    .metric-content {
        flex: 1;
    }
    
    .metric-value {
        font-size: 1.8rem;
        font-weight: bold;
        color: var(--text-color);
        margin-bottom: 0.3rem;
    }
    
    .metric-label {
        font-size: 0.9rem;
        color: var(--text-light);
        margin-bottom: 0.5rem;
    }
    
    .metric-trend {
        font-size: 0.8rem;
    }
    
    .metric-trend.up {
        color: var(--primary-color);
    }
    
    .metric-trend.down {
        color: var(--danger-color);
    }
    
    .metric-comparison {
        font-size: 0.8rem;
        color: var(--text-light);
    }
    
    /* 数据可视化区块 */
    .data-visualization {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .visual-card {
        background: white;
        border-radius: 10px;
        padding: 1.5rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    
    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
    }
    
    .card-header h3 {
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .action-btn {
        background: none;
        border: none;
        color: var(--text-light);
        cursor: pointer;
    }
    
    /* 进度条样式 */
    .progress-bars {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-item {
        margin-bottom: 0.8rem;
    }
    
    .progress-label {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }
    
    .progress-bar {
        height: 8px;
        background: #f5f5f5;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .progress-fill {
        height: 100%;
        border-radius: 4px;
    }
    
    /* 用户活跃度样式 */
    .activity-levels {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
    }
    
    .level-item {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .level-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
    }
    
    .level-dot.high {
        background: var(--primary-color);
    }
    
    .level-dot.medium {
        background: var(--warning-color);
    }
    
    .level-dot.low {
        background: var(--danger-color);
    }
    
    .level-info {
        flex: 1;
    }
    
    .level-label {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }
    
    .level-value {
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    .text-muted {
        color: var(--text-light);
        font-weight: normal;
    }
    
    /* 数据表格样式 */
    .data-table-section {
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        overflow: hidden;
    }
    
    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .section-header h3 {
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .styled-table-container {
        overflow-x: auto;
        padding: 0 1.5rem 1.5rem;
    }
    
    .styled-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.9rem;
    }
    
    .styled-table th,
    .styled-table td {
        padding: 1rem;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
    }
    
    .styled-table th {
        font-weight: 600;
        color: var(--text-light);
        background-color: #f9f9f9;
        white-space: nowrap;
    }
    
    .styled-table tr:last-child td {
        border-bottom: none;
    }
    
    .status-badge {
        display: inline-block;
        padding: 0.3rem 0.6rem;
        border-radius: 12px;
        font-size: 0.8rem;
        font-weight: 500;
    }
    
    .status-badge.completed {
        background: rgba(76, 175, 80, 0.1);
        color: var(--primary-color);
    }
    
    .status-badge.shipped {
        background: rgba(33, 150, 243, 0.1);
        color: var(--info-color);
    }
    
    .status-badge.processing {
        background: rgba(255, 193, 7, 0.1);
        color: var(--warning-color);
    }
    
    /* 响应式设计 */
    @media (max-width: 768px) {
        .dashboard-controls {
            flex-direction: column;
            align-items: stretch;
        }
        
        .time-filter {
            overflow-x: auto;
            padding-bottom: 0.5rem;
        }
        
        .metric-showcase {
            grid-template-columns: 1fr;
        }
        
        .data-visualization {
            grid-template-columns: 1fr;
        }
        
        .styled-table th,
        .styled-table td {
            padding: 0.75rem;
        }
    }